package org.example;

import org.example.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;


public class App {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookDao bookDao = context.getBean(BookDao.class);
        System.out.println(bookDao);
    }
}
//注解定义bean
//@Component:@Controller,@Service,@Repository
//纯注解开发：@Configuration
//纯注解开发：@ComponentScan
//AnnotationConfigApplicationContext